@extends('layout.detail')
@section('img')
    <div class="ad-image-wrapper" style="width:500px;height: 500px;">
        <img src="{{$goods->pic}}" style="width:100%">
    </div>
@endsection
@section('xiangqing')
    <form action="javascript:void(null)" method="post" name="ECS_FORMBUY" id="ECS_FORMBUY" >
        <div class="details">
            <h1 id="title">Razer/雷蛇&nbsp;<span id="productTitle">{{$goods->title}}</span></h1>
            <p></p>
            <div class="price-box">
                <h2 id="jiaqian">官方价：<font id="ECS_SHOPPRICE">￥{{$goods->price}}</font> <span class="orginal-price" style="display:none;">官方价：<font id="ECS_MARKETPRICE">￥{{$goods->price}}</font></span></h2>
                <h4 style="display:none;">促销信息 :
                    本商品购买赠送积分：
                    <span id="ECS_INTEGRAL">{{$goods->price}}分</span><br/>
                </h4>

            </div>
            <h4>服务：由雷蛇官方商城负责发货，并提供售后服务</h4>



            <div class="quantity">
                <h4 style="position:relative;" id="shuliang">数量：<span class="icon minus" id="minus-btn"></span><input id="number" type="text" value="1" onblur="inputNum();"  /><span class="icon plus" id="plus-btn"></span>
                    <span class="tip" style="position:absolute;top:0px;left:150px;"></span>
                </h4>
            </div>
            <div class="tt_tt">
                <script>
                    /**
                     * 分享效果
                     */
                    $(document).ready(function(){
                        var _this,vTimer;
                        $(".share").hover(function(){
                            clearTimeout(vTimer);
                            _this = $(this);
                            $('.shares').fadeIn();
                        },function(){
                            vTimer = setTimeout(function(){
                                $('.shares').fadeOut();
                            },1000)
                        })
                        $(".shares").hover(function(){
                            clearTimeout(vTimer);
                        },function(){
                            $(this).fadeOut();
                        })
                    })





                </script>
                <ul class="shares" style="position:absolute;top:30px;display:none;">
                    <li><a href="javascript:window.open('http://v.t.sina.com.cn/share/share.php?title='+encodeURIComponent(document.title)+'&url='+encodeURIComponent(document.location.href)+'&rcontent=');void(0)" class="xlwb">新浪微博</a></li>
                    <li><a href="javascript:window.open('http://sns.qzone.qq.com/cgi-bin/qzshare/cgi_qzshare_onekey?title='+encodeURIComponent(document.title)+'&url='+encodeURIComponent(document.location.href)+'&rcontent=');void(0)" class="qqkj">QQ空间</a></li>
                    <li><a href="javascript:window.open('http://v.t.qq.com/share/share.php?title='+encodeURIComponent(document.title)+'&url='+encodeURIComponent(document.location.href)+'&rcontent=');void(0)" class="txwb">腾讯微博</a></li>
                </ul>
                &nbsp;&nbsp;&nbsp;&nbsp;
                <div class="clear"></div>
            </div>
            <input id="get_amount" style ="display: none;" value="0" />
            <div class="button">
                <button class="razer-bttn bttn-medium liji" id="buy-now">立即购买</button>
                <a class="razer-bttn bttn-medium" id="add-to-cart">加入购物车</a>
            </div>
        </div>
    </form>
@endsection
@section('content')
    <p style="text-align: center">
        <img src="/hom/images/detailimages/133_thumb_P_1420531072783.jpg" alt="" />
        <img src="/hom/images/detailimages/133_thumb_P_1420531072204.jpg" alt="" />
        <img src="/hom/images/detailimages/133_thumb_P_1420531072106.jpg" alt="" />
        <img src="/hom/images/detailimages/4.jpg" alt="" />
        <img src="/hom/images/detailimages/5.jpg" alt="" />
        <img src="/hom/images/detailimages/1.jpg" width="880" height="957" alt="" />
    </p>
@endsection



@section('pinglun')
 <div class="product-info">
                
                <ul class="info-sub-menu">
                    <li class="active"><a href="#description" aria-controls="description" role="tab" data-toggle="tab">商品描述</a></li>    
                    <li><a href="#tech-specs"  aria-controls="teck-specs" role="tab" data-toggle="tab">规格参数</a></li>
                    <li><a href="#comment"  aria-controls="comment" role="tab" data-toggle="tab">商品评价列表</a></li>        
                    <li><a href="#qa" aria-controls="qa" role="tab" data-toggle="tab">商品问答</a></li>  
                      <li><a href="#qqqq" aria-controls="qa" role="tab" data-toggle="tab">商品评论</a></li>     
                    <li><a href="#post-service" aria-controls="post-service" role="tab" data-toggle="tab">售后服务</a></li>
                </ul>
                <div class="info-box">
                    <div id="description" class="tab-pane active">
                        @section('content')
                            <p style="text-align: center">
                                <img src="/hom/images/detailimages/133_thumb_P_1420531072783.jpg" alt="" />
                                <img src="/hom/images/detailimages/133_thumb_P_1420531072204.jpg" alt="" />
                                <img src="/hom/images/detailimages/133_thumb_P_1420531072106.jpg" alt="" />
                                <img src="/hom/images/detailimages/4.jpg" alt="" />
                                <img src="/hom/images/detailimages/5.jpg" alt="" />
                                <img src="/hom/images/detailimages/1.jpg" width="880" height="957" alt="" />
                            </p>
                        @show
                    </div>
                    <div id="tech-specs" class="tab-pane">                                                 
                    </div>
                    <div id="comment" class="tab-pane">
                        <script type="text/javascript" src="/detail/js/transport-new.js"></script>
                        <script type="text/javascript" src="/detail/js/utils.js"></script>
                    <div id="ECS_COMMENT">
     
                    <style>
                        .commentsList {color:#9d9d9d;}
                        .clearfix {color:#9d9d9d;}
                        .up_pinglun {height: 30px;width: 150px;border: none;border-radius: 2px;background-color: #037803;float: right;margin-right: 50px;font-size: 13px;color: #eee;cursor: pointer;display: block;text-align: center;line-height: 28px;-webkit-border-radius: 2px;}
                        .f2{color:##9d9d9d;}
                        .f3{float:right;}
                    </style>
                    <!--<h3> <span class="text">用户评论</span> 共<font class="f1">3</font>条评论</h3>-->
                    <h4 style="margin-left: 790px;">共<font class="f1">3</font>条评论</h4>
                    @if(!empty($content))
                    <ul class="post-box">
                                                <li>
                            <div class="avatar">
                               <img src="/detail/images/user-portrait.jpg"  width="125" height="125"/>
                                                                <p>{{$content->uname}}<!-- <font class="f3">( 2015-12-23 22:36:36 )</font> --></p>
                            </div>
                            
                            <div class="comment-content">
                                    <h3 class="comment-title">
                                    <font class="post-rate">
                                        <!--<img src="themes/razer/images/stars$comment.rank.gif" alt="$comment.comment_rank" />-->
                                        
                                       非常好
                                                                            
                                    </font>
                                    <font class="post-time">{{date('Y-m-d H:i:s',time())}}</font>
                                </h3>
                                <p>{{$content->content}}</p>
                                                              </div>
                        </li>
                                
                                
                                     </ul>
                            @endif
       
       <div id="pagebar" class="f_r">
        <form name="selectPageForm" action="/goods.php" method="get">
                <div id="pager">
          总计 3 个记录，共 1 页。 <span> <a href="javascript:gotoPage(1,133,0)">第一页</a> <a href="javascript:;">上一页</a> <a href="javascript:;">下一页</a> <a href="javascript:;">最末页</a> </span>
                    </div>
                </form>
        <script type="Text/Javascript" language="JavaScript">
        <!--
        
        function selectPage(sel)
        {
          sel.form.submit();
        }
        
        //-->
        </script>
      </div>
      
   
      
    <div class="blank5"></div>
  
<script type="text/javascript">
//<![CDATA[
var cmt_empty_username = "请输入您的用户名称";
var cmt_empty_email = "请输入您的电子邮件地址";
var cmt_error_email = "电子邮件地址格式不正确";
var cmt_empty_content = "您没有输入评论的内容";
var captcha_not_null = "验证码不能为空!";
var cmt_invalid_comments = "无效的评论内容!";
/**
 * 提交评论信息
*/
function submitComment(frm)
{
  var cmt = new Object;
  //cmt.username        = frm.elements['username'].value;
  cmt.email           = frm.elements['email'].value;
  cmt.content         = frm.elements['content'].value;
  cmt.type            = frm.elements['cmt_type'].value;
  cmt.id              = frm.elements['id'].value;
  cmt.enabled_captcha = frm.elements['enabled_captcha'] ? frm.elements['enabled_captcha'].value : '0';
  cmt.captcha         = frm.elements['captcha'] ? frm.elements['captcha'].value : '';
  cmt.rank            = 0;
  for (i = 0; i < frm.elements['comment_rank'].length; i++)
  {
    if (frm.elements['comment_rank'][i].checked)
    {
       cmt.rank = frm.elements['comment_rank'][i].value;
     }
  }
//  if (cmt.username.length == 0)
//  {
//     alert(cmt_empty_username);
//     return false;
//  }
   if (cmt.content.length == 0)
   {
      alert(cmt_empty_content);
      return false;
   }
   if (cmt.enabled_captcha > 0 && cmt.captcha.length == 0 )
   {
      alert(captcha_not_null);
      return false;
   }
   Ajax.call('comment.php', 'cmt=' + objToJSONString(cmt), commentResponse, 'POST', 'JSON');
   return false;
}
/**
 * 处理提交评论的反馈信息
*/
  function commentResponse(result)
  {
    if (result.message)
    {
      alert(result.message);
    }
    if (result.error == 0)
    {
      var layer = document.getElementById('ECS_COMMENT');
      if (layer)
      {
        layer.innerHTML = result.content;
      }
    }
  }
//]]>



 $('.liji').click(function(){
    // alert(111111111);
    var uname = $('#title').text();
    // var 
    // alert(uname);
    var jiaqian = $('#jiaqian').text();
    var shuliang = $('#plus-btn').text();
    alert(jiaqian);
    alert(shuliang);

    
});
</script></div>
                    </div>
                    
                     
                    <div id="qa" class="tab-pane">
                        <div id="GOODS_ECS_COMMENT">
     
    <!--<h3> <span class="text">用户评论</span> 共<font class="f1">0</font>提问</h3>-->
    
    <ul>
                      <li>暂时还没有任何用户提问</li>
             </ul>
      
      
       
       <div id="pagebar" class="f_r">
        <form name="goods_selectPageForm" action="/goods.php" method="get">
                <div id="pager">
          总计 0 个记录，共 1 页。 <span> <a href="javascript:gotoPage(1,133,0)">第一页</a> <a href="javascript:;">上一页</a> <a href="javascript:;">下一页</a> <a href="javascript:;">最末页</a> </span>
                    </div>
                </form>
        <script type="Text/Javascript" language="JavaScript">
        <!--
        
        function selectPage(sel)
        {
          sel.form.submit();
        }
        
        //-->
        </script>
      </div>
      
      <div class="blank5"></div>
      
      <div class="goods_commentsList" style="background: #000;height: 190px;padding: 25px 20px;border: 1px solid #333;">
      <form action="javascript:;" onsubmit="goods_submitComment(this)" method="post" name="goods_commentForm" id="goods_commentForm">
       <table width="710" border="0" cellspacing="5" cellpadding="0">
            <tr style="display:none;">
              <td width="64" align="right">用户名：</td>
              <td width="631">匿名用户</td>
            </tr>
            <tr style="display:none;">
              <td align="right">E-mail：</td>
              <td>
                               <input type="text" name="email" id="email"  maxlength="100" value="xxxx@163.com" class="inputBorder"/>
                
              </td>
            </tr>
            <tr style="display:none;">
              <td align="right">评价等级：</td>
              <td>
              <input name="comment_rank" type="radio" value="1" id="comment_rank1" /> <img src="/detail/images/stars1.png" />
              <input name="comment_rank" type="radio" value="2" id="comment_rank2" /> <img src="/detail/images/stars2.png" />
              <input name="comment_rank" type="radio" value="3" id="comment_rank3" /> <img src="/detail/images/stars3.png" />
              <input name="comment_rank" type="radio" value="4" id="comment_rank4" /> <img src="/detail/images/stars4.png" />
              <input name="comment_rank" type="radio" value="5" checked="checked" id="comment_rank5" /> <img src="images/stars5.png" />
              </td>
            </tr>
            <tr>
              <h2 style="font-size:18px;">我要提问：</h2>
              <td>
              <textarea name="content" class="inputBorder" style="box-shadow: none;border-radius: 0;background: #070707;border: 1px solid #333;width: 822px;height: 88px;"></textarea>
              <input type="hidden" name="cmt_type" value="0" />
              <input type="hidden" name="id" value="133" />
              </td>
            </tr>
        <tr>
          <td colspan="2">
                    <button name="" type="submit"  value="向购买者提问" class="razer-bttn bttn-medium" id="submit-btn" style="float: right;">发表提问</button>
          </td>
        </tr>
      </table>
      </form>
      </div>
      
  
    <div class="blank5"></div>
  
<script type="text/javascript">
//<![CDATA[
var cmt_empty_username = "请输入您的用户名称";
var cmt_empty_email = "请输入您的电子邮件地址";
var cmt_error_email = "电子邮件地址格式不正确";
var cmt_empty_content = "您没有输入评论的内容";
var captcha_not_null = "验证码不能为空!";
var cmt_invalid_comments = "无效的评论内容!";
/**
 * 提交评论信息
*/
function goods_submitComment(frm)
{
  var cmt = new Object;
  //cmt.username        = frm.elements['username'].value;
  cmt.email           = frm.elements['email'].value;
  cmt.content         = frm.elements['content'].value;
  cmt.type            = frm.elements['cmt_type'].value;
  cmt.id              = frm.elements['id'].value;
  cmt.enabled_captcha = frm.elements['enabled_captcha'] ? frm.elements['enabled_captcha'].value : '0';
  cmt.captcha         = frm.elements['captcha'] ? frm.elements['captcha'].value : '';
  cmt.rank            = 0;
  for (i = 0; i < frm.elements['comment_rank'].length; i++)
  {
    if (frm.elements['comment_rank'][i].checked)
    {
       cmt.rank = frm.elements['comment_rank'][i].value;
     }
  }
//  if (cmt.username.length == 0)
//  {
//     alert(cmt_empty_username);
//     return false;
//  }
   if (cmt.content.length == 0)
   {
      alert(cmt_empty_content);
      return false;
   }
 if (cmt.content.length <9 ||  cmt.content.length >500)
       {
          alert("提问内容必须在10~500之间！");
          return false;
       }
   if (cmt.enabled_captcha > 0 && cmt.captcha.length == 0 )
   {
      alert(captcha_not_null);
      return false;
   }
   Ajax.call('goods_comment.php', 'cmt=' + objToJSONString(cmt), goods_commentResponse, 'POST', 'JSON');
   return false;
}
/**
 * 处理提交评论的反馈信息
*/
  function goods_commentResponse(result)
  {
    if (result.message)
    {
//      alert(result.message);
      alert("感谢您的提问，请等待管理员的解答！");
    }
    if (result.error == 0)
    {
      var layer = document.getElementById('GOODS_ECS_COMMENT');
      if (layer)
      {
        layer.innerHTML = result.content;
      }
    }
  }
//]]>
</script></div>
                    </div>
                    
                     

     <div id="qqqq" class="tab-pane">
            <div id="GOODS_ECS_COMMENT">
     
    <!--<h3> <span class="text">用户评论</span> 共<font class="f1">0</font>提问</h3>-->
    
   
      
     
      
      <div class="blank5"></div>
      
      <div class="goods_commentsList" style="background: #000;height: 300px;padding: 25px 20px;border: 1px solid #333;">
      <form action="{{url('home/detail/insert')}}" onsubmit="goods_submitComment(this)" method="post" name="goods_commentForm" id="goods_commentForm">
       <table width="910px" border="0" cellspacing="5" cellpadding="0" >
           
            <tr style="height:30px">
              <td>评价等级
              <br>
              <input name="point" type="radio" value="1" id="comment_rank1" /> <img src="/hom/images/detailimages/stars1.png" /><br>
              <input name="point" type="radio" value="2" id="comment_rank2" /> <img src="/hom/images/detailimages/stars2.png" /><br>
              <input name="point" type="radio" value="3" id="comment_rank3" /> <img src="/hom/images/detailimages/stars3.png" /><br>
              <input name="point" type="radio" value="4" id="comment_rank4" /> <img src="/hom/images/detailimages/stars4.png" /><br>
              <input name="point" type="radio" value="5" checked="checked" id="comment_rank5" /> <img src="/hom/images/detailimages/stars5.png" />
              </td>
            </tr>
         
            <tr style="height:100px">
              <h2 style="font-size:18px;">评价：</h2>
              <td>
               <br>
              <textarea name="content" class="inputBorder" style="box-shadow: none;border-radius: 0;background: #070707;border: 1px solid #333;width: 822px;height: 88px;"></textarea>
              
              </td>
            </tr>
          <input type="hidden" name="trade_name" value="{{$goods->title}}">
          <input type="hidden" name="uid" value="{{$goods->id}}">
          <input type="hidden" name="uname" value="刘丽婷">
        <tr>
        {{csrf_field()}}
          <td colspan="2">
                    <button name="" type="submit"  value="向购买者提问" class="razer-bttn bttn-medium" id="submit-btn" style="float: right;">提交</button>
          </td>
        </tr>
      </table>
      </form>
      </div>
      
  
    <div class="blank5"></div>
  
<script type="text/javascript">
//<![CDATA[
var cmt_empty_username = "请输入您的用户名称";
var cmt_empty_email = "请输入您的电子邮件地址";
var cmt_error_email = "电子邮件地址格式不正确";
var cmt_empty_content = "您没有输入评论的内容";
var captcha_not_null = "验证码不能为空!";
var cmt_invalid_comments = "无效的评论内容!";
/**
 * 提交评论信息
*/
function goods_submitComment(frm)
{
  var cmt = new Object;
  //cmt.username        = frm.elements['username'].value;
  cmt.email           = frm.elements['email'].value;
  cmt.content         = frm.elements['content'].value;
  cmt.type            = frm.elements['cmt_type'].value;
  cmt.id              = frm.elements['id'].value;
  cmt.enabled_captcha = frm.elements['enabled_captcha'] ? frm.elements['enabled_captcha'].value : '0';
  cmt.captcha         = frm.elements['captcha'] ? frm.elements['captcha'].value : '';
  cmt.rank            = 0;
  for (i = 0; i < frm.elements['comment_rank'].length; i++)
  {
    if (frm.elements['comment_rank'][i].checked)
    {
       cmt.rank = frm.elements['comment_rank'][i].value;
     }
  }
//  if (cmt.username.length == 0)
//  {
//     alert(cmt_empty_username);
//     return false;
//  }
   if (cmt.content.length == 0)
   {
      alert(cmt_empty_content);
      return false;
   }
 if (cmt.content.length <9 ||  cmt.content.length >500)
       {
          alert("提问内容必须在10~500之间！");
          return false;
       }
   if (cmt.enabled_captcha > 0 && cmt.captcha.length == 0 )
   {
      alert(captcha_not_null);
      return false;
   }
   Ajax.call('goods_comment.php', 'cmt=' + objToJSONString(cmt), goods_commentResponse, 'POST', 'JSON');
   return false;
}
/**
 * 处理提交评论的反馈信息
*/
  function goods_commentResponse(result)
  {
    if (result.message)
    {
//      alert(result.message);
      alert("感谢您的提问，请等待管理员的解答！");
    }
    if (result.error == 0)
    {
      var layer = document.getElementById('GOODS_ECS_COMMENT');
      if (layer)
      {
        layer.innerHTML = result.content;
      }
    }
  }
//]]>


</script></div>
                    </div>


@endsection



